package cn.itcast.zt.java8.model.proxy.self;

import java.lang.reflect.Method;

/**
 * 编写工具类,这里是为了简化使用工厂执行相关方法的代码
 * create by zhangtian105 on 2021/9/15
 */
public class SwitchFunctionUtil {
    public static Object run(Method method, Object obj, Object... arg) throws Exception {
        SwitchFunction switchFunction = new SwitchFunction();
        SwitchFunctionProxy switchFunctionProxy = new SwitchFunctionProxy(switchFunction);
        return switchFunctionProxy.run(method, obj, arg);
    }
}
